Add full solenoid support on split keyboards #21583
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This provides a bugfix/enhancement that allows haptic feedback with solenoids to work on split keyboards. Support for haptic feedback on split keyboards was initially added in #19203 (aka #16233), but the feature was incomplete for solenoids (it didn't work at all). This PR fixes the solenoid problem, and also completes the feature by allowing the slave half to use the dwell time from the master half, meaning keycodes like
QK_HAPTIC_DWELL_UP
take immediate effect on both keyboard halves.The key change is to call
haptic_task()
fromkeyboard_task()
instead ofquantum_task()
, since solenoids require checking in the main keyboard loop in order to trigger, andquantum_task()
is run only by the master half.haptic_init()
was moved fromquantum_init()
tokeyboard_init()
for consistency.Currently, all
haptic_config
data is sent to the slave half, but the solenoid driver doesn't use dwell fromhaptic_config
even though it exists. It does usehaptic_config
for buzz, so there is some inconsistency there. This PR fixes that problem by using the dwell value fromhaptic_config
, meaning the dwell is now synchronized.I have tested this on a split keyboard, and it works to the best of my knowledge.
#define SOLENOID_DEFAULT_DWELL
sets a default value for both halves#define SPLIT_HAPTIC_ENABLE
disables the slave half but keeps the main half enabledTypes of Changes
Checklist